package org.timeticker;

import org.timeticker.Persistence;
import org.timeticker.impl.FSPersistenceImpl;

import java.io.File;

/**
 * Persistence Manager singleton.
 * Application will ask this manager to provide a persistance imlementation
 *
 * @author Ivan Latysh
 * @since 16-Jul-2007 : 9:44:33 PM
 * @version 0.1
 */
public class PersistenceManager {

  private static Persistence persistence;

  static {
    // @todo make FS root dir configurable 
    File file = new File(System.getProperty("user.dir"), "/activities");
    file.mkdirs();
    // create new persistence instance
    // @todo make persistance impl configurable
    persistence = new FSPersistenceImpl(file);
  }

  public static Persistence getInstance() {
    return persistence;
  }

  private PersistenceManager() {}

}
